package com.example.fastshare;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class ClickOnContactsDialog extends DialogFragment{
	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.click_on_contacts_dialog, null);
        TextView startConversation = (TextView) rootView.findViewById(R.id.click_on_contacts_dialog_startConversation);
        startConversation.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), ConversationActivity.class);
                startActivityForResult(myIntent, 0);
                dismiss();
            }
        });
        return rootView;
    }
	@Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        // Use the Builder class for convenient dialog construction
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
//        LayoutInflater inflater = getActivity().getLayoutInflater();
//        builder.setView(inflater.inflate(R.layout.click_on_contacts_dialog, null));
        // Create the AlertDialog object and return it
        builder.create();
        return builder.show();
    }
}
